//
//  SearchPoisCell.m
//  didacar
//
//  Created by 度周末网络-王腾 on 15/11/30.
//  Copyright © 2015年 dzmmac. All rights reserved.
//

#import "SearchPoisCell.h"
#import "AppColorConfig.h"
@implementation SearchPoisCell

- (void)awakeFromNib {
    [CommoneTools changeConstraintView:self.line constraintHeight:0.5];
}

-(void)setModel:(PoisModel *)poisModel{
    
    self.name.attributedText   = [self nameAttuributeString:poisModel.name];
    self.address.text= poisModel.address;
}

-(NSAttributedString *)nameAttuributeString:(NSString *)nameString{
    NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:nameString];
    NSRange range = [nameString rangeOfString:self.searchKeyWord];
    [str addAttribute:NSForegroundColorAttributeName value:GLOBLE_NAVIGATION_COLOR range:range];
    return str;
}
@end
